<template>
  <div>
    <HooksDemo :title="msg" :styleType="2" @register="register" ref="hooksDemoRef" />
    <a-button @click="handleClick">设置属性</a-button>
  </div>
</template>
<script setup>
  import { ref } from 'vue';
  import HooksDemo from './components/HooksDemo.vue';
  import { useHooksDemo } from './components/useHooksDemo';

  const hooksDemoRef = ref(null);

  const [register, methods] = useHooksDemo({
    title: '默认标题',
  });
  const msg = ref('hello world');
  const handleClick = () => {
    methods.setProps({
      title: '我是标题啊',
    });
    console.log(methods.getProps());
  };
</script>
